#include "stdafx.h"

#include "main_wnd.h"

using namespace DuiLib;
using namespace CodingSea;

int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR /*lpCmdLine*/, int nCmdShow)
{
    LOG_INIT(WinApi::GetModuleDir() + _T("\\log.conf"));
    MAKE_GUARD([&]() { LOG_UNINIT(); });

    LOG_METHOD_TRACE();

    HRESULT Hr = ::CoInitialize(NULL);
    if (FAILED(Hr)) {
        return 0;
    }

    MainWnd* pMain = new MainWnd();
    if (!pMain) {
        return 0;
    }

    pMain->CreateAndShow(hInstance);

    ::CoUninitialize();

    return 0;
}
